﻿using AutoMapper;
using FFLTask.SRV.ViewModel.Task;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FFLTask.SRV.ProdService.ViewModelMap.Helper;
using FFLTask.GLB.Global.Enum;
using Global.Core.ExtensionMethod;

//TODO: will rename back .TaskMap after removing all FilledBy()
namespace FFLTask.SRV.ViewModelMap.TaskMapAuto
{
    internal class StatusModelMap
    {
        internal static void init()
        {
            Mapper.CreateMap<Status, StatusModel>()
                .ForMember(s => s.Stage, opt => opt.MapFrom(s => (int)s))
                .ForMember(s => s.Name, 
                    opt => opt.MapFrom(s => ((Status)s).GetEnumDescription()))
                .IgnoreAllNonExisting()
                ;
        }
    }
}
